<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>CalendarUpdate.jsp</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	 <style type="text/css">
       #cal{
         width: 700px;
         height:400px;
         margin: 0px auto;
         
       }
       #cal label{
         font-weight: bold;
         font-size: 16px;
         font-family: monospace;
        
       }
       label:nth-last-child(4){
          color:red;
       }
       #cal input{
         height: 25px;
         margin:15px 10px;
       }
       #cal button{
         width: 80px;
         height: 30px;
         margin-top: 10px;
         float: right;
         margin-right: 25px;
       }
       textarea{
       
        margin-left: 100px;
       }
    </style>
    
    <script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
      function jiaoyan(){
         var start=document.getElementById("start").value;
         //alert(start);
         var end=document.getElementById("end").value;
         
         var time1=new Date(start.replace("-","/").replace("-","/"));
         var time2=new Date(end.replace("-","/").replace("-","/"));
         
         if(time1>time2){
          
          alert("结束时间小于开始时间！");
          document.getElementById("myform").action="";
		  
		  return false;	          
         }
         
      }
      function jy(){
         var start=document.getElementById("start").value;
         var color=document.getElementById("color").value;
         var title=document.getElementById("title").value;
         
         if(start==null||color==null||title==null||start==""||color==""||title==""){
           
           alert("字段添加不能为空！ ");
           return false;
         }
      
      }
      
    </script>
  </head>
  
  <body>
     <p style="margin: 15px 20px;">>>当前位置:个人日程修改</p>
     <hr style="color:#eee;">
     <div name="calender" id="cal" >
	      <form action="<%=request.getContextPath() %>/yz/CalendarActionupdate" method="post" id="myform" name="um" onsubmit="return jy()">
	        <!-- 全天时间: -->
	        <input type="hidden" name="calendar.id" value="${icalendar.id}">
	    	<label>开始时间：</label>
	    	<input type="text" id="start" name="calendar.start"  value="${icalendar.start}" readonly="readonly" onclick="WdatePicker(WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:00',onpicked:null}))" value="${param.date}" size="27" />
	    	<label>结束时间：</label>
	    	<input type="text" id="end" name="calendar.end" value="${icalendar.end}" onclick="WdatePicker(WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:00',onpicked:null}))" size="27" /><br>
	    	<label>会议地点：</label>
	    	<input type="text" name="calendar.color" size="80" id="color"  value="${icalendar.color}"/><br>
	    	<label >会议内容：</label><br>
	    	<textarea cols="60" rows="10" id="title" name="calendar.title" >${icalendar.title}</textarea><br>
	    	<button type="submit" onclick="return jiaoyan()">保存</button>
	    	<button onclick="javascript:document.um.action='<%=request.getContextPath() %>/yz/CalendarActiondelete';document.um.submit();" >删除</button>
	      </form>
    </div>
  </body>
</html>
